/*
 * @Description: 
 * @Author: mxy
 * @Date: 2022-12-04 20:55:35
 * @LastEditors: mxy
 * @LastEditTime: 2022-12-04 21:15:47
 */
// 1. 导入所需模块
import Vue from 'vue'
import VueRouter from 'vue-router'

import MyMovie from "@/components/MyMovie.vue";
import MyAbout from "@/components/MyAbout.vue";
import MyHome from "@/components/MyHome.vue";
import AboutMe from '@/components/AboutMe'
import AboutYou from '@/components/AboutYou'

// 2. 调用 Vue.use() 函数，将 VueRouter 安装为 Vue 的插件
Vue.use(VueRouter)

// 3. 创建路由的实例对象
const router = new VueRouter({
    routes: [
        { path: '/movie/:id/:name', component: MyMovie },
        {
            path: '/about', component: MyAbout, children: [
                { path: 'me', component: AboutMe },
                { path: 'you', component: AboutYou }
            ]
        },
        { path: '/home', component: MyHome }
    ]
})

// 4. 导出路由的实例对象
export default router
